package com.yoosora.common.mode.response;

import java.util.List;

/**
 * @author yoosora
 */
public class MultiResponse<T> extends AbstractResponse {
	private static final long serialVersionUID = 6089293404800884132L;
	private List<T> list;

	public MultiResponse() {
	}

	public List<T> getList() {
		return this.list;
	}

	public static <T> Builder<T> newBuilder() {
		return new Builder();
	}

	public static class Builder<T> extends AbstractResponse.Builder<Builder<T>> {
		private List<T> list;

		private Builder() {
		}

		public Builder<T> succ(List<T> list) {
			this.errcode = 0;
			this.list = list;
			return this;
		}

		public MultiResponse<T> build() {
			MultiResponse<T> resp = new MultiResponse();
			resp.errcode = this.errcode;
			resp.errmsg = this.errmsg;
			resp.list = this.list;
			return resp;
		}
	}
}
